<template>
    <div>
        <!-- 如果给school 打上ref="sch" 那么this.$refs.sch 就是vuecomponents -->
        <!-- 如果给school 打上id="sch" 那么document.getElementById('dch') 就是组件的html结构 -->
        <school></school>
        <school></school>
        <h2 v-text="msg" ref="hi"></h2>
        <button @click="clickme">点我显示上方元素</button>
    </div>
</template>

<script>
    import school from './components/school'

    export default {
        name: 'App',
        components: {
            school
        },
        data() {
            return {
                msg: 'hi'
            }
        },
        methods: {
            clickme() {
                console.log(this.$refs.hi)
            }
        },
    }
</script>